#ifndef _UI_PROGRESS_H_
#define _UI_PROGRESS_H_

#include <vector>
#include "ui_widget.h"
namespace ui
{
class UIProgress : public UIWidget
{
public:
	enum PROGRESS_TYPE {
		PROGRESS_HORZ = 0,
		PROGRESS_VERT,
		PROGRESS_FADE,
		PROGRESS_FADE_HORZ,
		PROGRESS_FADE_VERT,

		PROGRESS_C,
	};

/// stuff that every self-respecting widget should have
						UIProgress(UIWidget* pParent,const std::string& Name = "");
	virtual				~UIProgress();
	virtual bool		Create(const std::string& Name, const math::Vec2& Pos = math::Vec2(0.5f, 0.5f), const math::Vec2& Size= math::Vec2(0.1f, 0.1f));
	virtual	bool		Load(LuaPlus::LuaObject& _LObj);
	/// update
	virtual	bool		Tick(float dt);
	/// display
	virtual bool		Render(bool Force = false);

	virtual UIWidget*	GetClone();

	/// register with LUA Bind
	static	void		Register(LuaPlus::LuaState* _pScript);
	
	//// specifics for multiline	
	float				GetProgress() const { return m_Progress; };
	void				SetProgress(float f);
	void				SetEmptyImage(const std::string& Image)	{ SetImage(WI_EMPTY, Image); }
	void				SetFullImage(const std::string& Image)	{ SetImage(WI_FULL, Image); }
	void				FlashProgress(float Interval);
	virtual void		SetColor(float r, float g, float b, float a);
	
	void				SetFullColor(COLOR c) { m_FullColor = c; };
	void				SetEmptyColor(COLOR c) { m_EmptyColor = c; };

	void				SetProgressEnabled(bool b = true)	{ m_ProgEnabled = b; }
	bool				GetProgressEnabled() const			{ return m_ProgEnabled; }

	static std::string	MapProgressToString(PROGRESS_TYPE t);
	static PROGRESS_TYPE	MapStringToProgress(const std::string& t);

	void				SetProgressType(PROGRESS_TYPE Type);

protected:
	virtual bool		ExportSpecificsToFile(script::WriteLua*	pWL);

	// is this a progress bar?
	PROGRESS_TYPE			m_ProgType;
	float					m_Progress;
	bool					m_Flipped, m_FlipFade;
	COLOR					m_FullColor, m_EmptyColor;

	bool					m_ProgEnabled; // if disabled, will act like an ordinary UIWidget
};


}  //namespace ui

#endif // _UI_PROGRESS_H_